const path = require('path');

module.exports = {
	// This is the 'main' file which should include all modules
	entry: './src/main.js',
	// Where should the compiled file go?
	output: {
		// Go to 'dist' folder
		path: path.resolve(__dirname, 'dist'),
		// With the file name 'build.js', so it's dist/build.js
		filename: 'build.js',
		publicPath: 'dist/'
	},
	resolve: {
		alias: {
			'vue$': 'vue/dist/vue.common.js'
		}
	},
	module: {
		// Special compilation rules
		loaders: [{
			// Ask webpack to check: If the file ends with '.js', then apply some transforms
			test: /\.js/,
			// Transform it with babel
			loader: 'babel-loader',
			// Don't transform node_modules folder (which don't need to be compiled.)
			exclude: /node_modules/
		}, {
			test: /\.vue$/,
			loader: 'vue-loader'
		}, {
			test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
			loader: 'url-loader',
			options: {
				limit: 10000
			}
		}]
	}
}